package o;

final class afu {
    private final int ˊ;
    private int ˋ;
    private final byte[] ˎ;
    private int ॱ;

    public afu(byte[] bArr) {
        this.ˎ = bArr;
        this.ˊ = bArr.length;
    }

    public boolean ˏ() {
        boolean z = (((this.ˎ[this.ॱ] & 255) >> this.ˋ) & 1) == 1;
        ˎ(1);
        return z;
    }

    public int ॱ(int i) {
        int i2 = this.ॱ;
        int min = Math.min(i, 8 - this.ˋ);
        int i3 = i2 + 1;
        i2 = ((this.ˎ[i2] & 255) >> this.ˋ) & (255 >> (8 - min));
        while (min < i) {
            i2 |= (this.ˎ[i3] & 255) << min;
            min += 8;
            i3++;
        }
        i2 &= -1 >>> (32 - i);
        ˎ(i);
        return i2;
    }

    public void ˎ(int i) {
        int i2 = i / 8;
        this.ॱ += i2;
        this.ˋ = (i - (i2 * 8)) + this.ˋ;
        if (this.ˋ > 7) {
            this.ॱ++;
            this.ˋ -= 8;
        }
        ˎ();
    }

    public int ॱ() {
        return (this.ॱ * 8) + this.ˋ;
    }

    private void ˎ() {
        boolean z = this.ॱ >= 0 && (this.ॱ < this.ˊ || (this.ॱ == this.ˊ && this.ˋ == 0));
        amm.ˏ(z);
    }
}
